// 修改搜索结果链接在新标签页打开
function modifyLinks() {
  const searchDiv = document.getElementById('search');
  if (searchDiv) {
    const links = searchDiv.querySelectorAll('a');
    links.forEach(link => {
      if (!link.target) {
        link.target = '_blank';
      }
    });
  }
}

// 初始加载处理
document.addEventListener('DOMContentLoaded', modifyLinks);

// 监听动态内容变化
const observer = new MutationObserver((mutations) => {
  modifyLinks();
});

// 开始观察body元素
observer.observe(document.body, {
  childList: true,
  subtree: true
});
